// 路由设计
import VueRouter from "vue-router"

// 引入 tabbar 组件
import homeContainer from './components/tabbarComponent/homeConponent.vue'
import memberContainer from './components/tabbarComponent/memberComponent.vue'
import shopCartContainer from './components/tabbarComponent/shopcartComponent.vue'
import searchContainer from './components/tabbarComponent/searchComponent.vue'

// 引入 news 组件
import newsContainer from './components/newsComponent/newsList.vue'
import newsInfoContainer from './components/newsComponent/newsInfo.vue'

// 引入 photo 组件
import photoContainer from './components/photoComponent/photoList.vue'
import photoInfoContainer from './components/photoComponent/photoInfo.vue'

// 引入 goods 组件
import goodsContainer from './components/goodsComponent/goodsList.vue'
import goodsInfoContainer from './components/goodsComponent/goodsInfo.vue'
import goodsDescContainer from './components/goodsComponent/goodsDesc.vue'
import goodsCommentContainer from './components/goodsComponent/goodsComment.vue'


var router = new VueRouter({
    routes: [
        { path: '/', redirect: '/home'},
        // 首页
        { path: '/home', component: homeContainer},
        // 首页 新闻列表
        { path: '/home/newsList', component: newsContainer },
        // 首页 新闻列表详情
        { path: '/home/newsInfo/:id', component: newsInfoContainer },

        // 首页 图文分享
        { path: '/home/photoList', component: photoContainer },
        // 首页 图片详情
        { path: '/home/photoInfo/:id', component: photoInfoContainer },

        // 首页 商品购买
        { path: '/home/goodsList', component: goodsContainer },
        // 首页，商品详情
        { path: '/home/goodsInfo/:id', component: goodsInfoContainer },
        // 首页，图文介绍
        { path: '/home/goodsDesc/:id', component: goodsDescContainer, name: 'goodsDesc' },
        // 首页，商品评论
        { path: '/home/goodsComment/:id',
            component: goodsCommentContainer,
            name: 'goodsComment'
        },

        // 会员
        { path: '/member', component: memberContainer },

        // 购物车
        { path: '/shopCart', component: shopCartContainer },

        // 搜索
        { path: '/search', component: searchContainer }
    ],
    linkActiveClass: 'mui-active'
})


export default router